<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basicinfo/ceshifile/demo.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basicinfo/ceshifile/demo.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: '测试界面',
                name: 'ceshifile/demo',
                url: "/demo/",
                sortName: "name"
            });
            const editFormFields = ref({"name":"","age":"","sex":""});
            const editFormOptions = ref([[{"title":"名称","field":"name"},
                               {"title":"年龄","field":"age","type":"number"},
                               {"title":"性别","field":"sex"}]]);
            const searchFormFields = ref({"name":"","age":"","sex":""});
            const searchFormOptions = ref([[{"title":"年龄","field":"age","type":"number"},{"title":"性别","field":"sex"},{"title":"名称","field":"name","type":"like"}]]);
            const columns = ref([{field:'ID',title:'ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'name',title:'名称',type:'string',link:true,width:220,align:'left',sort:true},
                       {field:'age',title:'年龄',type:'int',width:80,align:'left'},
                       {field:'sex',title:'性别',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "测试详情",
                table: "DemoList",
                columns: [{field:'name',title:'名称',type:'string',sort:true,width:220,edit:{type:'text'},align:'left',sort:true},
                       {field:'zID',title:'Zid',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ID',title:'ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'age',title:'年龄',type:'int',width:80,edit:{type:''},align:'left'},
                       {field:'sex',title:'性别',type:'string',width:220,edit:{type:'text'},align:'left'}],
                sortName: "name",
                key: "zID"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
